Skip to content

feat: optional serialization support for core types #64

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Mar 28, 2025
Merged

Conversation

rklaehn
Copy link
Collaborator

@rklaehn rklaehn commented Mar 27, 2025

  • serialisation support (optional, via serde features)
  • eliminate macro that was used just once
  • more generic callbacks in experimental mixed io package

@rklaehn rklaehn requested a review from Copilot March 27, 2025 08:34
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces serialization support via serde, removes an underused macro, and refactors some callbacks in the experimental mixed io package to be more generic.

  • Added serde traits to several types and updated documentation for the hash_subtree workaround.
  • Refactored integer rounding operations to use div_ceil and changed the sender API in the mixed io module.
  • Updated Cargo.toml to enable serde features and removed the macros module that was used only once.

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/lib.rs Added serde imports, made hash_subtree public with updated docs, and updated rounding with div_ceil.
src/io/mod.rs Introduced serde serialization/deserialization for Parent and BaoContentItem.
src/io/mixed.rs Updated the sender trait to be generic and adjusted error propagation.
src/tree.rs Replaced the macros-based newtype with a manual implementation using serde.
src/io/error.rs Added serde support to EncodeError with a custom serializer for io::Error.
Cargo.toml Enabled serde support for bytes and added serde as an optional dependency.
src/macros.rs Removed the unused macros module.

@rklaehn rklaehn changed the title Support for the new blobs impl feat: optional serialization support for core types Mar 27, 2025
@rklaehn rklaehn marked this pull request as ready for review March 27, 2025 08:39
@n0bot n0bot bot added this to iroh Mar 27, 2025
@github-project-automation github-project-automation bot moved this to 🏗 In progress in iroh Mar 27, 2025
@rklaehn rklaehn merged commit df0ffcb into main Mar 28, 2025
26 checks passed
@github-project-automation github-project-automation bot moved this from 🏗 In progress to ✅ Done in iroh Mar 28, 2025
@rklaehn rklaehn deleted the baocontentitem branch March 28, 2025 08:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

1 participant